<%@page contentType="text/html; charset=utf-8" %>
<script type="text/javascript">
$(function() {
	console.info("22222222222222");
	$.easyui.loading({"locale": ".tabs-panels"});
	$.util.exec(function () {
		$.easyui.loaded(".tabs-panels");
    }, 1000);
	var $dg = $("#dg") ;
	$dg.datagrid({
		title: '用户管理',
		url: "/blue-web-admin-easyui/data/user.json?c",
		idField: 'emp_id', method: 'get', fit: true, border: false, 
		pageSize: 30, pageList: [30,40,50,100,200,1000	], rownumbers: true,
		remoteSort: true, striped:true, pagination: true, singleSelect: false, toolbar: '#toolbars', 
		sortName: 'num', sortOrder: 'asc',
		frozenColumns: [[
		    { field: 'ck', checkbox: true },
		    { field: 'id', title: 'ID', width: 80, hidden: true },
		    { field: 'account', title: '登录账号', width: 100, sortable: true, formatter:function(value,row){
		    	if(value == "未创建"){return "<font color='red'>"+value+"</font>";}else {return value ;}
		    }},
		    { field: 'password', title: '登录密码', width: 80, align: 'center', formatter:function(value,row){
		    	if(value == "未创建"){return "<font color='red'>"+value+"</font>";}else {return value ;}
		    }},
		    { field: 'status', title: '账号状态', width: 80, sortable: true, align: 'center', formatter:function(value,row){
		    	if(value == 0){return "<font color='#00CC00'>正常</font>";}else if(value == 1){return "<font color='red'>锁定</font>";}else if(value == 2){return "<font color='red'>未创建</font>";}
		    }}
		]],
		columns: [[
			{ field: 'num', title: '编号', width: 80, sortable: true },
		    { field: 'name', title: '姓名', width: 100 },
		    { field: 'sex', title: '性别', width:50, sortable: true, align: 'center'},
		    { field: 'org_name', title: '机构/部门', width: 180, tooltip: true }, 
		    { field: 'empState', title: '员工状态', width: 60, sortable: true, align: 'center', formatter:function(value,row){
		    	if(value == "在职"){return "<font color='#00CC00'>"+value+"</font>";}
		    	else if(value == "离职"){return "<font color='red'>"+value+"</font>";}
		    	else if(value == "退休"){return "<font color='#B91D47'>"+value+"</font>";}
		    }},
		    { field: 'role_names', title: '角色', width:100, tooltip: true },
		    { field: 'mobile', title: '手机号码', width:100 },
		    { field: 'email', title: '邮箱地址', width: 200, formatter: function(value, row) {
		    	return $.string.format("<a href='javascript:alert(\"因功能太多，或该功能优先级别低，暂时忘了实现，请提醒我。thk\");' class='clickLInk ext_email'>{0}</a>", value) ;
		    } },
		    { field: 'lastAcceccTime', title: '最后访问', width: 140, sortable: true },
		    { field: 'diffDatetime', title: '离线', width: 180, sortable: true },
		    { field: 'created', title: '创建时间', width: 140 },
			    { field: 'createName', title: '创建者', width: 140 },
			    { field: 'modifyDate', title: '最后修改时间', width: 140 },
			    { field: 'modifyName', title: '修改者', width: 140 }
		]],
		onLoadSuccess: function(node, data) {
			$dg.datagrid('unselectAll');$dg.datagrid('clearSelections');
		}
	});
	
});
</script>

<div id="dg"></div>
